package com.cr.service;

import java.util.List;

import com.cr.dao.ClothDao;
import com.cr.model.Cloth;

public class ClothService {
	private ClothDao dao=new ClothDao();
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	public Cloth getCloth(long id)
	{
		return dao.getCloth(id);
	}
	/**
	 * 
	 * @param cloth
	 * @return
	 */
	public boolean addCloth(Cloth cloth)
	{
		if(cloth==null)
			return false;
		return dao.addCloth(cloth);
	}
	/**
	 * 
	 * @param cloth
	 * @return
	 */
	public boolean updateCloth(Cloth cloth)
	{
		if(cloth==null)
			return false;
		return dao.updateCloth(cloth);
	}
	/**
	 * 
	 * @param id
	 * @return
	 */
	public boolean deleteCloth(long id)
	{
		return dao.deleteCloth(id);
	}

	public List<Cloth> getClothes(String condition)
	{
		return dao.getClothes(condition);
	}
}
